package com.work.ygj.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.work.ygj.entity.UserOpinion;
import com.work.ygj.mapper.UserOpinionMapper;
import com.work.ygj.pojo.dto.UserOpinionDto;
import com.work.ygj.pojo.vo.UserComplaintVo;
import com.work.ygj.pojo.vo.UserOpinionVo;
import com.work.ygj.service.UserOpinionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ygj
 * @since 2022-03-27
 */
@Service
public class UserOpinionServiceImpl extends ServiceImpl<UserOpinionMapper, UserOpinion> implements UserOpinionService {

    @Resource
    private UserOpinionMapper userOpinionMapper;

    @Override
    public IPage<UserOpinionVo> selectList(UserOpinionDto dto) {
        IPage<UserOpinionVo> page = new Page<>(dto.getPageIndex(), dto.getPageSize());
        List<UserOpinionVo> list = userOpinionMapper.userOpinionList(page,dto);
        page.setRecords(list);
        return page;
    }
}
